#include <iostream>
#include <string>
using namespace std;

//https://www.nowcoder.com/practice/f0db4c36573d459cae44ac90b90c6212?tpId=182&tqId=34789&ru=/exam/oj

int main()
{
    string str1, str2;

    bool hash[300] = { 0 };
    getline(cin, str1);
    getline(cin, str2);

    for (auto& e : str2)
        hash[e] = true;

    for (auto& ch : str1)
    {
        if (hash[ch] == false)
            cout << ch;
    }

    return 0;
}
